﻿using de.wolfmarco.pas.Client.Properties;
using de.wolfmarco.pas.Shared.Helper;
using de.wolfmarco.pas.Shared.Resources;
using Microsoft.Practices.Prism.Modularity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace de.wolfmarco.pas.Client.MVVM
{
    /// <summary>
    /// Interaktionslogik für StartMenuView.xaml
    /// </summary>
    public partial class StartMenuModuleView : UserControl
    {
        private readonly IModuleCatalog moduleCatalog;

        public StartMenuModuleView(IModuleCatalog moduleCatalog)
        {
            InitializeComponent();

            this.moduleCatalog = moduleCatalog;

            DataContextChanged += StartMenuModuleView_DataContextChanged;
        }

        private void StartMenuModuleView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            viewModel.CreateModuleButtons(moduleCatalog, panel);
        }

        private StartMenuModuleViewModel viewModel
        {
            get { return DataContext as StartMenuModuleViewModel; }
        }

        private ContentControl parentControl
        {
            get { return Parent as ContentControl; }
        }
    }
}
